/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package uniandes.edu.co;
import uniandes.edu.co.RC4;

public class main {
  
    public static void main(String[] args) throws Exception {
        int idSlave = 0;
        int letter = 0;
        if (args.length > 0) {
            try {
                idSlave = Integer.parseInt(args[0]);
            } catch (NumberFormatException e) {
                System.err.println("Argument must be an integer");
                System.exit(1);
            }
        }

        if(idSlave<10)
        {
            letter = idSlave+48;
        }else if(idSlave<=36)
        {
            letter = idSlave+65;
        }
        System.out.println("Job id: "+idSlave);
        System.out.println("Working on letter: "+(char)letter);

        RC4 rc4checker= new RC4();
        StringBuffer key = new StringBuffer();
        if(rc4checker.brutForceRC4(letter, letter, key))
        {
            System.out.println("Key is found: "+key);
        }else
        {
            System.out.println("No Key where found!");
        }

        
        
  }
   

    
}

